<?php

/**
 * ViewPlayers filter form base class.
 *
 * @package    raidpoints
 * @subpackage filter
 * @author     David Driscoll
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseViewPlayersFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'altid'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'name'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'fullname'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'guildedflag'    => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'created_by'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'updated_by'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'classid'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'genderid'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'raceid'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rankid'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'talentid'       => new sfWidgetFormFilterInput(),
      'talentindex'    => new sfWidgetFormFilterInput(),
      'talentname'     => new sfWidgetFormFilterInput(),
      'talentactive'   => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'talentmainspec' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'talenttankspec' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'talentgroup'    => new sfWidgetFormFilterInput(),
      'talentspec'     => new sfWidgetFormFilterInput(),
      'talenturl'      => new sfWidgetFormFilterInput(),
      'pclass'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'gender'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'race'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rank'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'altrank'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'ranksort'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'altid'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'name'           => new sfValidatorPass(array('required' => false)),
      'fullname'       => new sfValidatorPass(array('required' => false)),
      'guildedflag'    => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'created_by'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'updated_by'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'classid'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'genderid'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'raceid'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'rankid'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'talentid'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'talentindex'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'talentname'     => new sfValidatorPass(array('required' => false)),
      'talentactive'   => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'talentmainspec' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'talenttankspec' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'talentgroup'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'talentspec'     => new sfValidatorPass(array('required' => false)),
      'talenturl'      => new sfValidatorPass(array('required' => false)),
      'pclass'         => new sfValidatorPass(array('required' => false)),
      'gender'         => new sfValidatorPass(array('required' => false)),
      'race'           => new sfValidatorPass(array('required' => false)),
      'rank'           => new sfValidatorPass(array('required' => false)),
      'altrank'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ranksort'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('view_players_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ViewPlayers';
  }

  public function getFields()
  {
    return array(
      'id'             => 'Number',
      'altid'          => 'Number',
      'name'           => 'Text',
      'fullname'       => 'Text',
      'guildedflag'    => 'Boolean',
      'created_by'     => 'Number',
      'updated_by'     => 'Number',
      'classid'        => 'Number',
      'genderid'       => 'Number',
      'raceid'         => 'Number',
      'rankid'         => 'Number',
      'talentid'       => 'Number',
      'talentindex'    => 'Number',
      'talentname'     => 'Text',
      'talentactive'   => 'Boolean',
      'talentmainspec' => 'Boolean',
      'talenttankspec' => 'Boolean',
      'talentgroup'    => 'Number',
      'talentspec'     => 'Text',
      'talenturl'      => 'Text',
      'pclass'         => 'Text',
      'gender'         => 'Text',
      'race'           => 'Text',
      'rank'           => 'Text',
      'altrank'        => 'Number',
      'ranksort'       => 'Number',
    );
  }
}
